<?php
  require '../../include/library.inc.php';
  require '../../include/admin_login.inc.php';
    
 $descriptions = json_decode(stripslashes($_POST['data']));
  
 
	if($descriptions) {
	
		for($i = 1; $i < (sizeof($descriptions)); $i++)
		{
		$sql = "UPDATE project_gallery_description
							SET
								description = '".escape($descriptions[$i])."'
							WHERE
								image_id = '".$descriptions[0]."'
							AND lang_id = '".$i."'	
							  ";
		query($sql);
		}
		
		
		
		
		echo 'Saved!';
	}else{

  
 	 redirect($_SERVER['HTTP_REFERER']);
  }
?>